﻿{extend name="public/base" /}
{block name="main"}
<article class="page-container">
	<form action="<?php echo url('code/generate')?>" method="post" class="form form-horizontal" id="form-admin-role-save" >
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>控制器名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"  placeholder="控制器名称" name="controller_name">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>数据库表名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"   placeholder="数据库表名"  name="table_name">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>检索条件：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<table class="table table-border table-bg table-bordered">

					<thead>
						<tr><th colspan="3">说明：以下是是否生成检索条件，选择是该字段将会在创建表自动创建</th></tr>
						<tr>
							<th width="15%">title</th>
							<th>
								<span style="padding: 20px;"><input type="radio" value="1" name="title">&nbsp;&nbsp;&nbsp;&nbsp;是</span>
								<span><input type="radio" value="0" checked name="title">&nbsp;&nbsp;&nbsp;&nbsp;否</span>
							</th>
							<th>选择{是}添加标题，列表会自动生成根据标题检索，默认为like检索</th>
						</tr>
					</thead>
					<tbody>

					<tr class="active">
						<th>create_time</th>
						<td>
							<span style="padding: 20px;"><input type="radio" value="1" name="create_time">&nbsp;&nbsp;&nbsp;&nbsp;是</span>
							<span><input type="radio" value="0" checked name="create_time">&nbsp;&nbsp;&nbsp;&nbsp;否</span>
						</td>
						<th>选择{是}添加创建时间，列表会自动生成根据时间检索（添加时间控件）</th>
					</tr>
					</tbody>
				</table>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>生成模型：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input type="radio" id="sex-1" name="is_create_model" value="1">
					<label for="sex-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" name="is_create_model" checked value="0" >
					<label for="sex-2">否</label>
				</div>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"></label>
			<div class="formControls col-xs-8 col-sm-9">
				<h5 style="color: red">说明：当确认之后系统会自动创建数据表以及控制器文件，数据表名请不要加前缀我们将为你自动加上,如果有多个英文请用下划线隔开，注意规范，毕竟你是一个合格的程序员！！！！</span></h5>
				<p><h5>我们的系统并不依赖模型，生成一个空模型是为了了业务扩展，如果没有必要你可以选择不生成模型！</h5></p>
			</div>
		</div>

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<button type="submit" class="btn btn-success radius" id="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>
{/block}
{block name="js"}
<script type="text/javascript">
	$("#form-admin-role-save").validate({
		rules:{
			controller_name:{
                required:true,
                isEnglish:true,
			},
			table_name:{
                required:true,
                isRightfulString:true
			}
		},
		submitHandler:function(form){
			$(form).submit();
		}
	});


function closeWindow(){
	var index = parent.layer.getFrameIndex(window.name);
	window.parent.location.reload();
}
</script>
{/block}